package demo2;

import demo2.Animal;

public class Dog extends Animal {

    public Dog(String name, int age, float weight){
        super(name,age,weight);    //如果父类带有参构造方法 子类必须显示调用合适的父类构造方法
    }

    public void eat() {
        System.out.println(this.name + "正在吃狗粮---");
    }

    public void back() {
        System.out.println(this.name + "汪汪汪--");
    }
}
